<div>
    <table ng-if="orgInfos" cellpadding="0" cellspacing="0" border="0" class="datatable table table-striped table-bordered table-hover dataTable">
        <thead>
        <tr>
            <th>客户<input type="checkbox" ng-model="allCheck" ng-click="checkAll(allCheck)"></th>
            <th>机会名称</th>
            <th>机会代码</th>
            <th>状态</th>
            <th>预算</th>
            <th>胜算</th>
            <th>机会所有者</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-if="showRow($index)" ng-repeat="item in orgOppList|orderBy:orderList:reverse|filter:infosFilter">
            <td class="oneIn8" ng-init="showEditButton=false" ng-mouseenter="showEditButton=true" ng-mouseleave="showEditButton=false">
                <input type="checkbox" ng-model="item.$$checked">
                {{(item.customer?item.customer.companyBaseInfo.name:'无')|validateLinkStr}}
                <button class="btn btn-xs" ng-show="showEditButton" ng-click="editItemDetail(item.id)"><i class="fa fa-edit"></i>详细</button>
            </td>
            <td class="oneIn8">{{item.opportunity.oppName}}</td>
            <td class="oneIn8">{{item.opportunity.oppCode|validateLinkStr}}</td>
            <td class="oneIn8">{{item.opportunity.reality}}</td>
            <td class="oneIn8">{{item.opportunity.budget}}</td>
            <td class="oneIn8">{{item.opportunity.odds}}</td>
            <td class="oneIn8">{{item.$$owner?item.$$owner:"匿名"}}</td>
        </tr>
        </tbody>
    </table>
    <table ng-if="!orgInfos" cellpadding="0" cellspacing="0" border="0" class="datatable table table-striped table-bordered table-hover dataTable">
        <thead>
        <tr>
            <th class="oneIn5">名称</th>
            <th class="oneIn5">项目代码</th>
            <th class="oneIn5">上传该联系人到公司</th>
            <th class="oneIn5">以本地数据为准同步</th>
            <th class="oneIn5">以公司数据为准同步</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in userOppList|orderBy:orderList:reverse|filter:infosFilter">
            <td>{{item.opportunity.oppName}}</td>
            <td>{{item.opportunity.oppCode|validateLinkStr}}</td>
            <td class="text-center">
                <button ng-click="linkupOpp(item,false)" class="btn btn-xs btn-success" ng-if="!item.linkedOrgOpportunityId">链接到公司</button>
                <button ng-click="breakLinkOpp(item)" class="btn btn-xs btn-warning" ng-if="item.linkedOrgOpportunityId">取消链接</button>
            </td>
            <td class="text-center"><button ng-click="linkupOpp(item,false)" ng-if="item.linkedOrgOpportunityId" class="btn btn-xs btn-success">同步数据</button></td>
            <td class="text-center"><button ng-click="linkupOpp(item,true)" ng-if="item.linkedOrgOpportunityId" class="btn btn-xs btn-success">同步数据</button></td>
        </tr>
        </tbody>
    </table>
    <div class="row" ng-if="toState.name=='businessOpportunityManage'&&orgInfos">
        <div class="col-md-10"></div>
        <div class="col-md-2">
            <span style="float: right">总预算:{{orgOppList.$$totalForecast}}元</span>
        </div>
    </div>
</div>